package com.ruipengkj.commons.dao;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;

import com.ruipengkj.commons.base.query.PageModel;

public interface IGenericDao<T, ID extends Serializable> {
	//添加
	public void saveDao(T entity) throws RuntimeException ;
	//添加
	public Serializable saveRetDao(T entity) throws RuntimeException ;
	//添加或修改
	public void saveOrUpdateDao(T entity) throws RuntimeException ;
	//删除
	public void deleteDao(ID id) throws RuntimeException ;
	//修改
	public void modifyDao(T entity) throws RuntimeException ;
	//根据id查找
	public T getByIdDao(ID id) throws RuntimeException ;
	//根据条件翻页查询
	public PageModel<T> getScrollDao(String hql,String whereHQL,List<Object> param,int firstResult,int maxResult,LinkedHashMap<String, String> orderby) throws RuntimeException ;
	//根据条件查询
	public List<T> findDao(String hql,String whereHQL,List<Object> param,LinkedHashMap<String,String> orderby) throws RuntimeException ;
	//执行sql
	public void exeSQL2(final String _sql);

	public List<T> querySQL2(final String _sql, final Class retClass, String _setSQL);
	
	public int executeSQL(String sql);//执行sql
	public List<Object[]> querySQL(String sql);//执行sql查询
}
